<%@page import="com.firewolf.struts.jstl.beans.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>c:out标签</title>
</head>
<body>
	
	<!-- c:out等同于request.getAttribute或者session.getArttribute..... -->
	
	<!-- 设置属性 -->
	<!-- 1.普通属性 -->
	<%request.setAttribute("name", "刘兴"); %>
	
	<!-- 2.多个域中设置了相同属性名的属性 -->
	<%request.setAttribute("abc", "requestABC"); %>
	<%session.setAttribute("abc", "sessionABC"); %>
	<%application.setAttribute("abc", "applicationABC"); %>
	<%pageContext.setAttribute("abc", "pageContextABC"); %>
	
	<!-- 3.值中有超链接 -->
	<%request.setAttribute("link", "你好，<a href='http://www.baidu.com'>百度</a>"); %>

	<!-- 4.设置对象 -->
	<%
		User user = new User();
		user.setName("刘兴");
		user.setAge(29);
		request.setAttribute("user", user);
	%>
	<!-- ------------------- -->	
	
	
	①.直接输入结果：<br>
	<c:out value="Hello,World"></c:out><br>
	②.取出域对象中的属性<br>
	<c:out value="${name }"></c:out><br>
	③.域对象中相同属性名，cout的优先级为：pageContext > request > session > application<br>
	<c:out value="${abc }"></c:out><br>
	④.属性中包含了超链接，要显示出链接<br>
	<c:out value="${link }" escapeXml="false"></c:out><br>
	⑤.获取对象中的属性<br>
	<c:out value="${user.name }"></c:out><br>
</body>
</html>